<template>
    <div class="exam-wrap">
        <div class="main clearfix">

            <mt-field label="考生工号：" placeholder="请输入工号" v-model="jobnumber"></mt-field>

        </div>
        <div class="btn-box">
            <!-- <mt-button type="danger" size="large">重置</mt-button> -->
            <mt-button type="primary" size="large" @click="addsubmit">确定</mt-button>
            <!-- <button type="button" @click="addsubmit">确定</button> -->
        </div>

    </div>
</template>

<style>
    .main{
        padding: 0px 15px;
    }
    .title{
        font-size: 16px;
        padding: 10px 15px 15px;
        text-align: center;
    }
    .test-main{
        width: 90%;
    }
    .btn-box{
        text-align: center;
        margin: 160px 0px 0px;
    }
    .btn-box button{
        width: 42%;
        display: inline-block;
        margin: 0 2%;
        color: #fff;
        background-color: #26a2ff;
    }
    input[type="text"]:disabled{
        background-color: #fff;
    }
    .mint-popup{
        width: 100%;
    }
    .picker-item{
        text-align: center;
    }
    .sure{
        position: absolute;
        right: 0px;
        background: #fff;
        color: #26a2ff;
        box-shadow: none;
    }
    .cancel{
        position: absolute;
        left: 0px;
        background: #fff;
        color: #26a2ff;
        box-shadow: none;
    }
    .mint-button::after{
        background: #fff;
    }
    input:focus{
        border: none;
    }
</style>

<script>
    import conf from '../config/userconf.js'
    export default {
        name:"addexaminee",
        data() {
            return {
                jobnumber: '',  //工号
            };
        },
        methods: {

            //添加考生  确认
            addsubmit(data=Object()){
                if(!this.jobnumber){
                    this.$toast('请填写工号');
                }else{
                    data.paperid = this.$route.query.id;  //试卷id
                    data.jobnumber = this.jobnumber;   //工号
                    
                    //添加考生
                    conf.exams.addExaminee(data,(state,res)=>{
                        if (state == 'success'&&res.data.status == 1){
                            // console.log(res.data);
                            this.$toast(res.data.message);
                            
                        }else if(state == 'success'&&res.data.status != 1){
                            this.$toast(res.data.message);
                        }
                    })
                }
                
            },
            
        },
        mounted (){
            document.title = "添加考生";
        },
    }
</script>